﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using MockPrjTeam2.Common;

namespace MockPrjTeam2.Entity
{
    public class Service
    {
        public int ServiceId { get; set; }
        public int ContactId { get; set; }
        public string ServiceName { get; set; }
        public string ServiceShortDescription { get; set; }
        public string SubType { get; set; }
        public string ContactName { get; set; }
        public string ClientDescription { get; set; }
        public string ServiceAttendance { get; set; }
        public DateTime? ServiceStartExpected { get; set; }
        public DateTime? ServiceStartDate { get; set; }
        public DateTime? ServiceEndDate { get; set; }
        public int ServiceExtendableMonth { get; set; }
        public int ServiceExtendableYear { get; set; }
        public int ServiceTimeLimitedMonth { get; set; }
        public int ServiceTimeLimitedYear { get; set; }
        public string ServiceFullDescription { get; set; }
        public string DeptCode { get; set; }
        public string ServiceType { get; set; }
        public string ServiceDescriptionDelivery { get; set; }
        public string ServiceContactCode { get; set; }
        public string ServiceContactValue { get; set; }
        public bool ContractStagedPayment { get; set; }
        public string ReferralProcessMethod { get; set; }
        public string ContractOutcome { get; set; }
        public string Participation { get; set; }
        public string ContractObligation { get; set; }
        public string FundingSource { get; set; }
        public string FundingContactDetails { get; set; }
        public string FundingAmount { get; set; }
        public DateTime? FundingStart { get; set; }
        public DateTime? FundingEnd { get; set; }
        public string FundraisingForText { get; set; }
        public string FundraisingWhy { get; set; }
        public bool FundraisingDonorAnonymous { get; set; }
        public string FundraisingDonorAmount { get; set; }
        public string FundingNeeds { get; set; }
        public string FundingContinuationAmount { get; set; }
        public string FundingContinuationDetails { get; set; }
        public string FundraisingNeeds { get; set; }
        public DateTime? FundraisingRequiredBy { get; set; }
        public DateTime? FundraisingCompletedDate { get; set; }
        public DateTime? FundraisingDonationDate { get; set; }
        public bool FundraisingDonationIncremental { get; set; }
        public string ServiceBenefitsCriterion { get; set; }
        public string ServiceBarriersCriterion { get; set; }
        public string ServiceEthnicityCriterion { get; set; }
        public string ServiceDisabilityCriterion { get; set; }
        public string ServicePersonalCircumtancesCriterion { get; set; }
        public string OtherServiceParticipationCriterion { get; set; }
        public string ClientSuportProcess { get; set; }
        public string Intervention { get; set; }
        public string ClientJourney { get; set; }
        public string ClientOutcome { get; set; }
        public string TargetClient { get; set; }
        public string Accreditations { get; set; }
        public string ReferalSources { get; set; }
        public string Programme { get; set; }
        public bool IsActive { get; set; }

        /// <summary>
        /// Mappings the entity.
        /// </summary>
        /// <param name="row">The row.</param>
        /// <returns></returns>
        public static Service MappingEntity(DataRow row)
        {
            Service service = null;
            if (row != null)
            {
                service = new Service
                {
                    ServiceId = Utilities.ToInt(row, "ServiceID"),
                    ContactId = Utilities.ToInt(row, "ContactId"),
                    ServiceName = Utilities.ToString(row, "ServiceName"),
                    ServiceShortDescription = Utilities.ToString(row, "ServiceShortDescription"),
                    SubType = Utilities.ToString(row, "SubType"),
                    ContactName = Utilities.ToString(row, "ContactName"),
                    ClientDescription = Utilities.ToString(row, "ClientDescription"),
                    ServiceAttendance = Utilities.ToString(row, "ServiceAttendance"),
                    ServiceStartExpected = Utilities.ToDateTime(row, "ServiceStartExpected"),
                    ServiceStartDate = Utilities.ToDateTime(row, "ServiceStartDate"),
                    ServiceEndDate = Utilities.ToDateTime(row, "ServiceEndDate"),
                    ServiceExtendableMonth = Utilities.ToInt(row, "ServiceExtendableMonth"),
                    ServiceExtendableYear = Utilities.ToInt(row, "ServiceExtendableYear"),
                    ServiceTimeLimitedMonth = Utilities.ToInt(row, "ServiceTimeLimitedMonth"),
                    ServiceTimeLimitedYear = Utilities.ToInt(row, "ServiceTimeLimitedYear"),
                    ServiceFullDescription = Utilities.ToString(row, "ServiceFullDescription"),
                    DeptCode = Utilities.ToString(row, "DeptCode"),
                    ServiceType = Utilities.ToString(row, "ServiceType"),
                    ServiceDescriptionDelivery = Utilities.ToString(row, "ServiceDescriptionDelivery"),
                    ServiceContactCode = Utilities.ToString(row, "ServiceContactCode"),
                    ServiceContactValue = Utilities.ToString(row, "ServiceContactValue"),
                    ContractStagedPayment = Utilities.ToNullableBoolean(row, "ContractStagedPayment"),
                    ReferralProcessMethod = Utilities.ToString(row, "ReferralProcessMethod"),
                    ContractOutcome = Utilities.ToString(row, "ContractOutcome"),
                    Participation = Utilities.ToString(row, "Participation"),
                    ContractObligation = Utilities.ToString(row, "ContractObligation"),
                    FundingContactDetails = Utilities.ToString(row,"FundingContactDetails"),
                    FundingSource = Utilities.ToString(row, "FundingSource"),
                    FundingAmount = Utilities.ToString(row, "FundingAmount"),
                    FundingStart = Utilities.ToDateTime(row, "FundingStart"),
                    FundingEnd = Utilities.ToDateTime(row, "FundingEnd"),
                    FundraisingForText = Utilities.ToString(row, "FundraisingForText"),
                    FundraisingWhy = Utilities.ToString(row, "FundraisingWhy"),
                    FundraisingDonorAnonymous = Utilities.ToNullableBoolean(row,
                    "FundraisingDonorAnonymous"),
                    FundraisingDonorAmount = Utilities.ToString(row, "FundraisingDonorAmount"),
                    FundingNeeds = Utilities.ToString(row, "FundingNeeds"),
                    FundingContinuationAmount = Utilities.ToString(row, "FundingContinuationAmount"),
                    FundingContinuationDetails = Utilities.ToString(row, "FundingContinuationDetails"),
                    FundraisingNeeds = Utilities.ToString(row, "FundraisingNeeds"),
                    FundraisingRequiredBy = Utilities.ToDateTime(row, "FundraisingRequiredBy"),
                    FundraisingCompletedDate = Utilities.ToDateTime(row, "FundraisingCompletedDate"),
                    FundraisingDonationDate = Utilities.ToDateTime(row, "FundraisingDonationDate"),
                    FundraisingDonationIncremental = Utilities.ToNullableBoolean(row,
                    "FundraisingDonationIncremental"),
                    ServiceBenefitsCriterion = Utilities.ToString(row, "ServiceBenefitsCriterion"),
                    ServiceBarriersCriterion = Utilities.ToString(row, "ServiceBarriersCriterion"),
                    ServiceEthnicityCriterion = Utilities.ToString(row, "ServiceEthnicityCriterion"),
                    ServiceDisabilityCriterion = Utilities.ToString(row, "ServiceDisabilityCriterion"),
                    ServicePersonalCircumtancesCriterion = Utilities.ToString(row,
                    "ServicePersonalCircumtancesCriterion"),
                    OtherServiceParticipationCriterion = Utilities.ToString(row,
                    "OtherServiceParticipationCriterion"),
                    ClientSuportProcess = Utilities.ToString(row, "ClientSuportProcess"),
                    Intervention = Utilities.ToString(row, "Intervention"),
                    ClientJourney = Utilities.ToString(row, "ClientJourney"),
                    ClientOutcome = Utilities.ToString(row, "ClientOutcome"),
                    TargetClient = Utilities.ToString(row, "TargetClient"),
                    Accreditations = Utilities.ToString(row, "Accreditations"),
                    ReferalSources = Utilities.ToString(row, "ReferalSources"),
                    Programme = Utilities.ToString(row, "Programme"),
                    IsActive = Utilities.ToNullableBoolean(row, "IsActive")
                };
            }

            return service;
        }
    }
}